<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns a representation that can be converted to JSON</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="mongodb-bson-decimal128.construct.html">« MongoDB\BSON\Decimal128::__construct</a></li>
      <li style="float: right;"><a href="mongodb-bson-decimal128.serialize.html">MongoDB\BSON\Decimal128::serialize »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.mongodb-bson-decimal128.html">MongoDB\BSON\Decimal128</a></li>
    <li>Returns a representation that can be converted to JSON</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="mongodb-bson-decimal128.jsonserialize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\BSON\Decimal128::jsonSerialize</h1>
  <p class="verinfo">(mongodb &gt;=1.2.0)</p><p class="refpurpose"><span class="refname">MongoDB\BSON\Decimal128::jsonSerialize</span> &mdash; <span class="dc-title">Returns a representation that can be converted to JSON</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-bson-decimal128.jsonserialize-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\BSON\Decimal128::jsonSerialize</strong></span>(): <span class="type"><a href="language.types.declarations.html#language.types.declarations.mixed" class="type mixed">mixed</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-bson-decimal128.jsonserialize-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-bson-decimal128.jsonserialize-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns data which can be serialized by <span class="function"><a href="function.json-encode.html" class="function">json_encode()</a></span> to
   produce an extended JSON representation of the
   <span class="classname"><a href="class.mongodb-bson-decimal128.html" class="classname">MongoDB\BSON\Decimal128</a></span>.
  </p>
  
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <span class="simpara">
    The output is consistent with the <span class="function"><a href="function.mongodb.bson-tojson.html" class="function">MongoDB\BSON\toJSON()</a></span>
    function, which uses the driver-specific legacy extended JSON format. This
    does not necessarily match the
    <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json.rst#relaxed-extended-json-example" class="link external">&raquo;&nbsp;relaxed</a>
    or <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json.rst#canonical-extended-json-example" class="link external">&raquo;&nbsp;canonical</a>
    extended JSON representations used by
    <span class="function"><a href="function.mongodb.bson-torelaxedextendedjson.html" class="function">MongoDB\BSON\toRelaxedExtendedJSON()</a></span> and
    <span class="function"><a href="function.mongodb.bson-tocanonicalextendedjson.html" class="function">MongoDB\BSON\toCanonicalExtendedJSON()</a></span>, respectively.
   </span>
  </p></blockquote>

 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-bson-decimal128.jsonserialize-errors">
  <h3 class="title">错误／异常</h3>
  <ul class="simplelist">
   <li class="member">Throws <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.html" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> on argument parsing errors.</li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-bson-decimal128.jsonserialize-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li class="member"><span class="methodname"><a href="jsonserializable.jsonserialize.html" class="methodname" rel="rdfs-seeAlso">JsonSerializable::jsonSerialize()</a> - 指定需要被序列化成 JSON 的数据</span></li>
   <li class="member"><span class="function"><a href="function.json-encode.html" class="function" rel="rdfs-seeAlso">json_encode()</a> - 对变量进行 JSON 编码</span></li>
   <li class="member"><span class="function"><a href="function.mongodb.bson-tocanonicalextendedjson.html" class="function" rel="rdfs-seeAlso">MongoDB\BSON\toCanonicalExtendedJSON()</a> - Returns the Canonical Extended JSON representation of a BSON value</span></li>
   <li class="member"><span class="function"><a href="function.mongodb.bson-torelaxedextendedjson.html" class="function" rel="rdfs-seeAlso">MongoDB\BSON\toRelaxedExtendedJSON()</a> - Returns the Relaxed Extended JSON representation of a BSON value</span></li>
   <li class="member"><a href="https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/" class="link external">&raquo;&nbsp;MongoDB Extended JSON</a></li>
  </ul>
 </div>


</div></div></div></body></html>